import time

from ConfigurationData import timeNum
from datetime import datetime

from TradeBeforeExecution import choose_trade_direction
from getAverageTradeVolume import getAverageTradeVolume


def main():
    while True:
        print("--------------------------------------当前时间:", datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
        try:
            #选择主要程序方向todo
            #getAverageTradeVolume()

            choose_trade_direction()
            retries = 10
            time.sleep(timeNum)
        except Exception  as e:
            print(f"网络请求出现问题：{e}")
            time.sleep(timeNum / 3)
            retries -=1
            if retries == 0:
                break
            continue



# 设置交易对和杠杆
main()



